\subsection{t0.c File Reference}
\label{t0_8c}\index{t0.c@{t0.c}}


T=0 functions.  


{\ttfamily \#include $<$config.h$>$}\par
{\ttfamily \#include $<$sw.h$>$}\par
{\ttfamily \#include $<$hal.h$>$}\par
{\ttfamily \#include $<$t0.h$>$}\par
{\ttfamily \#include $<$types.h$>$}\par
\subsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void {\bf t0\_\-sendAck} (void)
\begin{DoxyCompactList}\small\item\em Send ACK byte. \item\end{DoxyCompactList}\item 
void {\bf t0\_\-sendCAck} (void)
\begin{DoxyCompactList}\small\item\em Send complemented ACK byte. \item\end{DoxyCompactList}\item 
void {\bf t0\_\-sendSw} (void)
\begin{DoxyCompactList}\small\item\em Send word in sw. \item\end{DoxyCompactList}\item 
void {\bf t0\_\-sendWord} ({\bf iu16} w)
\begin{DoxyCompactList}\small\item\em Send word. \item\end{DoxyCompactList}\item 
void {\bf t0\_\-recBlock} ({\bf iu8} $\ast${\bf dst}, {\bf iu8} len)
\begin{DoxyCompactList}\small\item\em Receive mutiple bytes. \item\end{DoxyCompactList}\item 
{\bf bool} {\bf t0\_\-testP1P2} ({\bf iu16} p1p2)
\begin{DoxyCompactList}\small\item\em Test P1P2 for correct content. \item\end{DoxyCompactList}\item 
{\bf bool} {\bf t0\_\-testP3} ({\bf iu8} p3)
\begin{DoxyCompactList}\small\item\em Test P3 for correct content. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
{\bf iu8} {\bf header} [5]
\begin{DoxyCompactList}\small\item\em Header of the current command. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsubsection{Detailed Description}
T=0 functions. \begin{DoxyParagraph}{Id:}
\doxyref{t0.c}{p.}{t0_8c},v 1.13 2002/12/22 15:42:55 m Exp 
\end{DoxyParagraph}


\subsubsection{Function Documentation}
\index{t0.c@{t0.c}!t0\_\-recBlock@{t0\_\-recBlock}}
\index{t0\_\-recBlock@{t0\_\-recBlock}!t0.c@{t0.c}}
\paragraph[{t0\_\-recBlock}]{\setlength{\rightskip}{0pt plus 5cm}void t0\_\-recBlock (
\begin{DoxyParamCaption}
\item[{{\bf iu8} $\ast$}]{ dst, }
\item[{{\bf iu8}}]{ len}
\end{DoxyParamCaption}
)}\hfill\label{t0_8c_a5419cbdf36cc2942a04070ec60486346}


Receive mutiple bytes. 

Receive {\itshape len\/} bytes and write them to {\itshape dst\/}.


\begin{DoxyParams}{Parameters}
\item[{\em dst}]Pointer to destination area in RAM. \item[{\em len}]Data bytes to receive. \end{DoxyParams}


References hal\_\-io\_\-recByteT0().



Referenced by cmd\_\-changeUnblockPIN(), cmd\_\-create(), cmd\_\-extAuth(), cmd\_\-intAuth(), and cmd\_\-verifyKeyPIN().

\index{t0.c@{t0.c}!t0\_\-sendAck@{t0\_\-sendAck}}
\index{t0\_\-sendAck@{t0\_\-sendAck}!t0.c@{t0.c}}
\paragraph[{t0\_\-sendAck}]{\setlength{\rightskip}{0pt plus 5cm}void t0\_\-sendAck (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\hfill\label{t0_8c_a66185e38e65e9a6578930f13601b20b8}


Send ACK byte. 

Sends the for the current command correct ACK byte to the terminal. 

References hal\_\-io\_\-sendByteT0(), and header.



Referenced by cmd\_\-changeUnblockPIN(), cmd\_\-create(), cmd\_\-delete(), cmd\_\-extAuth(), cmd\_\-getChallenge(), cmd\_\-getResponse(), cmd\_\-intAuth(), cmd\_\-read(), cmd\_\-readBinary(), cmd\_\-select(), and cmd\_\-verifyKeyPIN().

\index{t0.c@{t0.c}!t0\_\-sendCAck@{t0\_\-sendCAck}}
\index{t0\_\-sendCAck@{t0\_\-sendCAck}!t0.c@{t0.c}}
\paragraph[{t0\_\-sendCAck}]{\setlength{\rightskip}{0pt plus 5cm}void t0\_\-sendCAck (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\hfill\label{t0_8c_a88c4c061649e7862b87be5ee05443c61}


Send complemented ACK byte. 

Sends the for the current command correct complemented ACK byte to the terminal. 

References hal\_\-io\_\-sendByteT0(), and header.



Referenced by cmd\_\-updateBinary(), and cmd\_\-write().

\index{t0.c@{t0.c}!t0\_\-sendSw@{t0\_\-sendSw}}
\index{t0\_\-sendSw@{t0\_\-sendSw}!t0.c@{t0.c}}
\paragraph[{t0\_\-sendSw}]{\setlength{\rightskip}{0pt plus 5cm}void t0\_\-sendSw (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\hfill\label{t0_8c_a08bf4056ff75f0ac8fc01cafc51a7c9d}


Send word in sw. 

Sends the word in sw the the terminal. This is used to return the status word at the end of the command interpreter loop in \doxyref{main()}{p.}{authtest_8c_a0ddf1224851353fc92bfbff6f499fa97}. 

References hal\_\-io\_\-sendByteT0(), and sw.



Referenced by main().

\index{t0.c@{t0.c}!t0\_\-sendWord@{t0\_\-sendWord}}
\index{t0\_\-sendWord@{t0\_\-sendWord}!t0.c@{t0.c}}
\paragraph[{t0\_\-sendWord}]{\setlength{\rightskip}{0pt plus 5cm}void t0\_\-sendWord (
\begin{DoxyParamCaption}
\item[{{\bf iu16}}]{ w}
\end{DoxyParamCaption}
)}\hfill\label{t0_8c_adab516e464f021b20d67bf25e1032301}


Send word. 


\begin{DoxyParams}{Parameters}
\item[{\em w}]Word to send. \end{DoxyParams}


References hal\_\-io\_\-sendByteT0().



Referenced by main().

\index{t0.c@{t0.c}!t0\_\-testP1P2@{t0\_\-testP1P2}}
\index{t0\_\-testP1P2@{t0\_\-testP1P2}!t0.c@{t0.c}}
\paragraph[{t0\_\-testP1P2}]{\setlength{\rightskip}{0pt plus 5cm}{\bf bool} t0\_\-testP1P2 (
\begin{DoxyParamCaption}
\item[{{\bf iu16}}]{ p1p2}
\end{DoxyParamCaption}
)}\hfill\label{t0_8c_a0a5fec56b63d21ea44278bd8b3c151c3}


Test P1P2 for correct content. 

Compares the values of P1 and P2 in {\itshape header\/} to {\itshape p1p2\/}. If they differ, sw is set to SW\_\-WRONG\_\-P1P2 and FALSE is returned.


\begin{DoxyParams}{Parameters}
\item[{\em p1p2}]Target value of P1P2.\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em TRUE}]on success. \item[{\em FALSE}]on failure. Error code given in sw. \end{DoxyRetVals}


References header, sw\_\-set(), and SW\_\-WRONG\_\-P1P2.



Referenced by cmd\_\-changeUnblockPIN(), cmd\_\-create(), cmd\_\-delete(), cmd\_\-extAuth(), cmd\_\-getChallenge(), cmd\_\-getResponse(), cmd\_\-intAuth(), cmd\_\-select(), and cmd\_\-verifyKeyPIN().

\index{t0.c@{t0.c}!t0\_\-testP3@{t0\_\-testP3}}
\index{t0\_\-testP3@{t0\_\-testP3}!t0.c@{t0.c}}
\paragraph[{t0\_\-testP3}]{\setlength{\rightskip}{0pt plus 5cm}{\bf bool} t0\_\-testP3 (
\begin{DoxyParamCaption}
\item[{{\bf iu8}}]{ p3}
\end{DoxyParamCaption}
)}\hfill\label{t0_8c_a4fb7c1ea98c7bb6a8d85bad1ad79f36c}


Test P3 for correct content. 

Compares the value of P3 in {\itshape header\/} to {\itshape p3\/}. If they differ, sw is set to SW\_\-WRONG\_\-P1P2 and FALSE is returned.


\begin{DoxyParams}{Parameters}
\item[{\em p3}]Target value of P3.\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
\item[{\em TRUE}]on success. \item[{\em FALSE}]on failure. Error code given in sw. \end{DoxyRetVals}


References header, sw\_\-set(), and SW\_\-WRONG\_\-LEN.



Referenced by cmd\_\-changeUnblockPIN(), cmd\_\-create(), cmd\_\-delete(), cmd\_\-extAuth(), cmd\_\-getChallenge(), cmd\_\-getResponse(), cmd\_\-intAuth(), cmd\_\-select(), cmd\_\-updateBinary(), cmd\_\-verifyKeyPIN(), and cmd\_\-write().



\subsubsection{Variable Documentation}
\index{t0.c@{t0.c}!header@{header}}
\index{header@{header}!t0.c@{t0.c}}
\paragraph[{header}]{\setlength{\rightskip}{0pt plus 5cm}{\bf iu8} {\bf header}[5]}\hfill\label{t0_8c_a309a16173373bae33919e7c0f13732b5}


Header of the current command. 

This global variable contains the header (CLA INS P1 P2 P3) of the current command. It is fetched in the command interpreter loop in \doxyref{main()}{p.}{authtest_8c_a0ddf1224851353fc92bfbff6f499fa97}. 

Referenced by cmd\_\-read(), cmd\_\-write(), main(), t0\_\-sendAck(), t0\_\-sendCAck(), t0\_\-testP1P2(), and t0\_\-testP3().

